import http from './http'
import { Login, LoginOut } from '../auth'

const login = async( user, password ) => {
    let response = await http.fetchPost('/api/admin/login', { username : user, password : password })
    if(response && response.username != null && response.password != null){
        Login(response)
        return true
    }
    return false
}

const loginOut = async () =>{
    LoginOut()
}

export default {
    login,
    loginOut
}